package cn.ronghuanet.base.controller;

import cn.ronghuanet.base.service.IVerifyCodeService;
import cn.ronghuanet.base.util.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/common/verifycode")
@Api(tags = "验证码")
public class VerifyCodeController {

    @Autowired
    private IVerifyCodeService verifyCodeService;

    @GetMapping("/imageCode/{key}")
    @ApiOperation("图形验证码")
    public AjaxResult getImageCode(@PathVariable("key") String key){
        return verifyCodeService.getImageCode(key);
    }
}